package com.woniuxy.huayoung.controller;

import com.woniuxy.huayoung.result.ResponseResult;
import com.woniuxy.huayoung.service.BusinessLogService;
import com.woniuxy.huayoung.service.ExceptionLogService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author dushen
 * @className: SystemController
 * @description: TODO 类描述
 * @create 2021-07-26-14:16
 */
@RestController
@Api("系统相关配置接口")
@RequestMapping("/system")
public class SystemController {

    @Resource
    private ExceptionLogService exceptionLogService;

    @Resource
    private BusinessLogService businessLogService;

    @GetMapping("get/exceptionLog")
    public ResponseResult<Object> getException() {
        return new ResponseResult<>().setCode(200).setMessage("请求成功").setData(exceptionLogService.getAllExceptionLog());
    }

    @GetMapping("get/businessLog")
    public ResponseResult<Object> getBusiness() {
        return new ResponseResult<>().setCode(200).setMessage("请求成功").setData(businessLogService.getAllBusinessLog());
    }
}
